package com.zg.scf.web;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zg.common.core.R;
import com.zg.scf.domain.req.company.CompanyPageReq;
import com.zg.scf.domain.vo.CompanyVo;
import com.zg.scf.service.CompanyInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@RequestMapping("/company/info")
@Slf4j
@Api(tags = "企业信息或机构信息")
public class CompanyInfoController {

    private final CompanyInfoService companyInfoService;


    @PostMapping("/isAuth")
    @ApiOperation(value = "认证管理")
    public R<Boolean> isAuth(@RequestParam("id") Long id) {
        Boolean isAuth = companyInfoService.isAuth(id);
        return R.success(isAuth);
    }


    @PostMapping("/page")
    @ApiOperation(value = "分页查询企业或融资企业信息列表")
    public R<IPage<CompanyVo>> page(@RequestBody CompanyPageReq pageReq) {
        IPage<CompanyVo> page=companyInfoService.page(pageReq);
        return R.success(page);
    }
}
